@extends('admin')

@section('content')

    <p class="mb10">
        <a href="{{url('admin/product/newt')}}" class="btn J_dialog" title="添加类别"><span class="add"></span>添加类别</a>
    </p>

    <div class="table_list">
        <div id="data_list">
            <table class="items">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>类别名称</th>
                    <th>级别</th>
                    <th>父级分类</th>
                    <th>状态</th>
                    <th>发布时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach ($list as $item)
                    <tr>
                        <td>{{$item->categoryid}}</td>
                        <td>{{$item->name}}</td>
                        <td>{{'1' == $item->rank ? "一级分类" : "二级分类"}}</td>
                        <td>{{'1' == $item->rank ? "无" : $parent[$item->parentid]}}</td>
                        <td>{{1 == $item->isShow ? "启用" : "停用"}}</td>
                        <td>{{$item->inputDate}}</td>
                        <td>
                            <a href="{{url('admin/product/newt/'.$item->categoryid)}}" title="编辑 {{$item->name}}" class="mr10 J_dialog">[编辑]</a>
                            <a href="{{url('admin/product/delt/'.$item->categoryid)}}" class="mr10 J_ajax_del">[删除]</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>

        <div class="summary">
            共有 {{$list->total()}} 条数据
        </div>
        @if ($list->hasPages())
            <div class="pager">
                {!! $list->render() !!}
            </div>
        @endif
    </div>

@stop